package com.xsm.adapter;

import java.util.List;

import android.support.v4.view.PagerAdapter;
import android.support.v4.view.ViewPager;
import android.view.View;
import android.view.ViewGroup;

public class ViewPagerAdapter extends PagerAdapter{
	List<View> views;
	public ViewPagerAdapter(List<View> views){
		this.views=views;
	}
	public int getCount() {
		if(views!=null)
		return views.size();
		else {
			return 0;
		}
	}
	public boolean isViewFromObject(View arg0, Object arg1) {
		return arg0==arg1;
	}
	public void destroyItem(ViewGroup container, int position, Object object) {
		container.removeView(views.get(position));
	}
	public Object instantiateItem(ViewGroup container, int position) {
		container.addView(views.get(position),0);
		return views.get(position);
	}
}
